The script need to be executed in Magento 2 root folder.
- It deletes all the contents of
varsubfolder exceptvar/sessionsubfolder and except the.htaccessfile
- It deletes all the contents of
pub/staticsubfolder except the.htaccessfile
find var/* -type f -or -type d | grep -v 'session' | xargs rm -rf && \
rm -rf pub/static/*